home *** CD-ROM | disk | FTP | other *** search
- /* Switch statement example */
- class switcher {
-
- static public void main (String args[]) {
-
- char c = 'o';
-
- /* test the c variable */
- switch (c) {
- case 'a' : System.out.println("apple");
- break;
- case 'e' : System.out.println("eggplant");
- break;
- case 'i' : System.out.println("iris");
- break;
- case 'o' : System.out.println("orange");
- break;
- case 'u' : System.out.println("unyon");
- break;
- default : System.out.println("That is not a vowel");
- }
-
- }
- }
-